package com.bindatax.core.task.event;

import com.bindatax.core.log.LogOutInterface;
import com.bindatax.core.log.LogOutManager;
import com.bindatax.core.task.DataTask;
import com.bindatax.core.task.row.EventValueData;
import com.bindatax.core.task.segment.SegmentWork;
import com.bindatax.core.util.StringUtils;

import java.util.HashSet;

public abstract class BaseListenEvent implements ListenEventInterface {
    protected final static LogOutInterface LOG = LogOutManager.get();
    protected HashSet<EventType> eventTypes = new HashSet<>();
    protected String id = StringUtils.generateUniqueId();
    protected boolean stop = false;
    @Override
    public String getId() {
        return id;
    }

    @Override
    public EventScope getScope() {
        return EventScope.PROTOTYPE;//默认多例
    }

    @Override
    public HashSet<EventType> getTypes() {
        return eventTypes;
    }

    @Override
    public boolean isStop() {
        return stop;
    }

    @Override
    public void exe(EventType type, DataTask thisTask, SegmentWork thisSegmentWork, EventValueData rowData) {
        //LOG.debug("执行监控事件。模式："+ getScope().getDescription() +"，详情：" + type.getDescription() );
    }
}
